home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 November: Tool Chest / Dev.CD Nov 96 TC / Dev.CD Nov 96 TC.toast / Sample Code / Toolbox / ControlStrip Test / SimpleApp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-24  |  17.2 KB  |  491 lines  |  [TEXT/CWIE]

  1. /*************************************************************************
  2. **    Apple Macintosh Developer Technical Support
  3. **
  4. **    Simple App Framework
  5. **
  6. **    by Matthew Xavier Mora, Apple Developer Technical Support mxmora@apple.com
  7. **
  8. **    File:        SimpleApp.h
  9. **
  10. **    Copyright © 1995-1996 Apple Computer, Inc.
  11. **    All rights reserved.
  12. **
  13. **    You may incorporate this sample code into your applications without
  14. **    restriction, though the sample code has been provided "AS IS" and the
  15. **    responsibility for its operation is 100% yours.  However, what you are
  16. **    not permitted to do is to redistribute the source as "DSC Sample Code"
  17. **    after having made changes. If you're going to re-distribute the source,
  18. **    we require that you make it clear in the source that the code was
  19. **    descended from Apple Sample Code, but that you've made changes.
  20. **
  21. **************************************************************************/
  22.  
  23. #include <Lists.h>
  24. #include <AppleEvents.h>
  25.  
  26. #ifndef __SIMPLEAPP__
  27. #define __SIMPLEAPP__
  28.  
  29. /*---------------------------------------------------------------------------------- */
  30. #pragma mark Defines
  31. /*---------------------------------------------------------------------------------- */
  32. #define    kMagicSig                 (0x4D584D21)    /* 'MXM!' our magic signature */
  33. #define    kMaxMenus                 (20)
  34. #define    kMaxMenuItems             (128)
  35. #define    kMaxButtons             (128)
  36. #define    kMaxEventProcs             (10)
  37. #define    kAppleEventLoadingErr     (129)
  38. #define kScrollBarType            'scrl'
  39. #define    kEventPassThru             (true)        /* This lets the event pass thru to the default handler */
  40. #define    kEventOverRide             (false)        /* This overides the event and doesn't call to the default handler */
  41.  
  42. #define    kUpArrow                 (30)
  43. #define    kDownArrow                 (31)
  44. #define    kEnterKey                 (0x03)
  45. #define    kReturnKey                 (0x0D)
  46. #define    kTabKey                 (0x09)
  47.  
  48. #define    kAppleNum                 (128)
  49. #define    kFileNum                 (129)
  50. #define    kEditNum                 (130)
  51. #define    kMenuStartID             (127)
  52. #define    kMargin                 (5)
  53. #define    kUseStandardMenu         (true)
  54.  
  55. #define    kErrorBase                ( 0 )     //    Base value for SimpleApp Error Numbers
  56. #define    kSAStandardDebugAlert     ( 9999)
  57. #define    kSANonFatalError         ( kErrorBase )
  58. #define    kSAFatalError             ( kErrorBase - 1 )
  59. #define    kSABadSelectorErr        ( kErrorBase - 2 )
  60. #define    kSABadProcPtr            ( kErrorBase - 3 )    
  61. #define    kNotOurWindowError         ( kErrorBase - 4 )    
  62. #define    kNotValidObject            ( kErrorBase - 5 )
  63.  
  64. #define kSANoCommandKey         ( 0 )    // value for no command key equivalent
  65.  
  66. /*---------------------------------------------------------------------------------- */
  67. #pragma mark typedefs
  68. /*---------------------------------------------------------------------------------- */
  69. typedef            Str255 StringArray;
  70.  
  71. typedef            StringArray *StringArrayPtr,**StringArrayHandle ;
  72.  
  73. typedef            ControlRef ControlArray[];
  74. typedef            ControlArray *ControlArrayPtr,**ControlArrayHandle;        
  75.         
  76. typedef    struct    GroupRec             GroupRec,        *GroupRecPtr,        **GroupRecHandle;
  77. typedef    struct    ObjectItemRec         ObjectItemRec,    *ObjectItemRecPtr,    **ObjectItemRecHandle;
  78. typedef struct    MenuItemRec         MenuItemRec,    *MenuItemRecPtr ,    **MenuItemRecHandle ;
  79. typedef struct    ButtonItemRec         ButtonItemRec,    *ButtonItemRecPtr,    **ButtonItemRecHandle;
  80. typedef            ButtonItemRecHandle ButtonItemRef;
  81.  
  82. typedef pascal SInt16      (* MenuHitProc)      ( SInt32 modifiers);
  83. typedef pascal SInt16      (* MenuUpdateProc )    ( SInt32 modifiers);
  84. typedef pascal SInt16      (* ButtonHitProc)    ( ButtonItemRef me,SInt32 modifiers) ;
  85. typedef pascal SInt16      (* ButtonUpdateProc)( ButtonItemRef me,SInt32 modifiers);
  86. typedef pascal void       (* MyActionProc)    ( ControlHandle control,SInt16 part);
  87. typedef pascal Boolean     (* AboutProc)         ( SInt32 data);
  88.  
  89. typedef pascal Boolean     (* PreGroupHitProc)        (SInt32 modifiers ,Point pt, ControlArrayPtr cap , SInt16 count) ;
  90. typedef pascal SInt16     (* PostGroupHitProc)    ( SInt32 modifiers ,ControlRef cr,ButtonItemRecHandle brh, SInt16 item);
  91. typedef pascal SInt16     (* GroupUpdateProc)        ( WindowRef wind,GroupRecHandle grh );
  92.  
  93. typedef pascal SInt16     (*    WindowHitProc)        ( SInt32 modifiers);
  94. typedef pascal SInt16     (*    ListHitProc )        ( SInt32 modifiers) ;
  95. typedef pascal SInt16     (*    EditFieldHitProc)    ( SInt32 modifiers) ;
  96. typedef pascal SInt16     (*    WindowUpdateProc)    ( SInt32 modifiers) ;
  97. typedef pascal SInt16     (*    ListUpdateProc)        ( SInt32 modifiers) ;
  98. typedef pascal void         (*    ListDrawCellProc)    ( Point thecell, Rect *bounds ,ListRef listID );
  99. typedef pascal SInt16     (*    EditFieldUpdateProc)( SInt32 modifiers) ;
  100.  
  101. typedef pascal SInt16     (*    WindowIdleProc)        ( SInt32 modifiers ) ;
  102. typedef pascal SInt16     (*    ListIdleProc )        ( SInt32 modifiers ) ;
  103. typedef pascal SInt16     (*    EditFieldIdleProc)    ( SInt32 modifiers ) ;
  104. typedef pascal SInt16     (*    WindowGrowProc)        ( EventRecord *event );
  105. typedef pascal SInt16     (*    WindowZoomProc)        ( EventRecord *event );
  106. typedef pascal SInt16     (*    WindowActivateProc)    ( Boolean isActivating ) ;
  107.         
  108. typedef pascal SInt16     (*    TextFieldHitProc)    ( SInt32 modifiers) ;
  109. typedef pascal SInt16     (*    TextFieldUpdateProc)( SInt32 modifiers) ;
  110. typedef pascal SInt16     (*    EventProcs)            ( EventRecord *event) ;
  111. typedef pascal SInt16     (*    TerminateProc)        ( SInt32 flags) ;
  112. typedef pascal SInt16     (*    InitializeProc)        ( SInt32 flags) ;
  113. typedef pascal SInt16     (*    LowMemProc)            ( SInt32 flags ) ;
  114. typedef pascal SInt16     (*    MenuEventProc)        ( SInt32 menuResult);
  115. typedef pascal void         (*    WindowCloseProc)    ( WindowRef * theWindow);
  116.  
  117. /* generic object stuff */
  118. typedef pascal Handle    (* ObjectInitProc)        ( ObjectItemRecHandle orh);
  119. typedef pascal OSErr     (* ObjectDisposeProc)    ( ObjectItemRecHandle orh);
  120. typedef pascal SInt16     (* ObjectHitProc )         ( Point *pt,SInt32 modifiers, ObjectItemRecHandle me);
  121. typedef pascal SInt16     (* ObjectTrackProc )     ( Point *pt,SInt32 modifiers, ObjectItemRecHandle me);
  122. typedef pascal SInt16     (* ObjectUpdateProc)    ( WindowRef window, RgnHandle update,ObjectItemRecHandle me) ;
  123. typedef pascal void      (* ObjectKeyProc )        ( char keyCode, char theChar,SInt32 modifiers);
  124.  
  125. /* Apple Event Stuff */
  126. typedef pascal OSErr     (* OpenDocProc )     ( AppleEvent *ae, AppleEvent * AEreply,SInt32 handlerRefcon);
  127. typedef pascal OSErr     (* OpenAppProc )     ( AppleEvent *ae, AppleEvent * AEreply, SInt32 handlerRefcon);
  128. typedef pascal OSErr     (* QuitAppProc )     ( AppleEvent *ae, AppleEvent * AEreply, SInt32 handlerRefcon);
  129. typedef pascal OSErr     (* PrintDocProc )     ( AppleEvent *ae, AppleEvent * AEreply, SInt32 handlerRefcon);
  130. typedef pascal SInt16     (* ScriptProc )     ( SInt16 resId);
  131.  
  132.  
  133. struct MenuItemRec {
  134.     SInt16             menuID  ;
  135.     SInt16             menuItem  ;
  136.     Handle             menuObject  ;
  137.     MenuHitProc     menuHit  ;
  138.     MenuUpdateProc     menuUpdate  ;
  139. };
  140.  
  141. struct    GroupRec {
  142.     long                 groupType;
  143.     GroupRecHandle         nextGroup;
  144.     short                 groupID;
  145.     WindowRef             window ;
  146.     Str255                 groupTitle;
  147.     long                  groupRefCon;
  148.     short                 groupControlCount; 
  149.     StringArrayPtr         groupControlnames; 
  150.     Rect                 groupBounds ; 
  151.     short                 groupHSpacing;
  152.     short                 groupVSpacing ;
  153.     short                 groupFlags;
  154.     PreGroupHitProc     groupPreHit ; 
  155.     PostGroupHitProc     groupPostHit ; 
  156.     GroupUpdateProc     groupUpdate ;
  157.     ControlArrayPtr     groupControlArray;
  158. };
  159.             
  160. struct ButtonItemRec {
  161.     long                buttonType;
  162.     ButtonItemRef        nextButton  ;
  163.     SInt16                 buttonID  ;
  164.     ControlRef             buttonObject  ;
  165.     long                buttonRefCon;
  166.     GroupRecHandle        buttonGroup;
  167.     ButtonHitProc         buttonHit  ;
  168.     ButtonUpdateProc    buttonUpdate  ;
  169. };
  170.  
  171. /*
  172.  
  173.                 buttonType:longint; 
  174.                 nextButton: ButtonItemRecHandle;
  175.                 buttonID: integer;
  176.                 buttonObject: ControlHandle;
  177.                 buttonRefCon    : longint;
  178.                 buttonGroup:GroupRecHandle;
  179.                 buttonHit: ButtonHitProc;
  180.                 buttonUpdate: ButtonUpdateProc;
  181.                 
  182.                 
  183. */
  184.  
  185. typedef struct     ScrollItemRec ScrollItemRec,*ScrollItemRecPtr, **ScrollItemRecHandle;    
  186.                 
  187. struct        ScrollItemRec {
  188.     SInt32 scrollType;
  189.     ScrollItemRecHandle nextScroll;
  190.     SInt16 scrollID;
  191.     ControlHandle scrollObject;
  192.     MyActionProc scrollHit;
  193.     MyActionProc scrollUpdate;
  194.     MyActionProc scrollIndicator;
  195.     MyActionProc scrollButton;
  196. };
  197.  
  198. struct PrintAreaRec {
  199.         Rect windowPrintRect  ;
  200.         SInt16 windowPrintHorz  ;
  201.         SInt16 windowPrintVert  ;
  202.         SInt16 windowPrintLineHeight  ;
  203.         SInt16 windowPrintMaxVert  ;
  204.         SInt16 windowPrintMargin  ;
  205. };
  206. typedef struct PrintAreaRec PrintAreaRec ,* PrintAreaRecPtr,**PrintAreaRecHandle;
  207.  
  208. typedef struct    ListItemRec ListItemRec,*ListItemRecPtr,**ListItemRecHandle ;
  209.  
  210. struct    ListItemRec {
  211.     ListItemRecHandle nextList  ;
  212.     ListRef listObject  ;
  213.     SInt16 listID  ;
  214.     ListHitProc listHit  ;
  215.     ListUpdateProc listUpdate  ;
  216.     ListIdleProc listIdle  ;
  217. };
  218.  
  219. typedef struct    EditFieldItemRec EditFieldItemRec,*EditFieldItemRecPtr,**EditFieldItemRecHandle ;
  220.  
  221. struct EditFieldItemRec {
  222.     EditFieldItemRecHandle nextEdit  ;
  223.     SInt16 editFieldID  ;
  224.     SInt32 editFieldFlags ;
  225.     TEHandle editFieldObject  ;
  226.     EditFieldHitProc editFieldHit  ;
  227.     EditFieldUpdateProc editFieldUpdate  ;
  228.     EditFieldIdleProc editFieldIdle  ;
  229. }; 
  230.  
  231.  
  232. enum { 
  233.         EditType,
  234.         ListType,
  235.           ButtonType
  236. } ;
  237. typedef SInt8 contentItemType;
  238.         
  239. struct    ContentRec {
  240.     SInt16 contentCount  ;
  241.     contentItemType kind  ;
  242.     union {
  243.         EditFieldItemRec efr  ;
  244.         ListItemRec lir  ;
  245.         ButtonItemRec bir ;         
  246.     };
  247. };
  248.  
  249. typedef struct     ContentRec ContentRec,*    ContentRecPtr;
  250.         
  251. typedef ContentRec WindowItemsArray[];
  252. typedef ContentRec * WindowItemsArrayPtr;
  253.  
  254. struct WindowItemRec {
  255.         SInt32                     windowMagic  ; /* Signature so we know our windows */
  256.         SInt16                     windowID  ;
  257.         WindowRef                 windowObject  ;
  258.         WindowHitProc             windowHit  ;
  259.         WindowUpdateProc         windowUpdate  ;
  260.         WindowIdleProc             windowIdle  ;
  261.         WindowGrowProc             windowGrow  ;
  262.         WindowActivateProc         windowActivate  ;
  263.         WindowCloseProc            windowClose;
  264.         WindowZoomProc            windowZoom;
  265.         PrintAreaRec             windowPrintAreaRec  ;
  266.         FSSpec                     windowFSSpec  ;
  267.         SInt16                   windowRefNum;
  268.         ListItemRecHandle         windowLists  ;
  269.         EditFieldItemRecHandle     windowEdits  ;
  270.         ButtonItemRecHandle     windowButtons  ;
  271.         ScrollItemRecHandle     windowScroll;
  272.         Boolean                 windowHasControls  ;
  273.         Boolean                 windowHasLists  ;
  274.         Boolean                 windowHasEditField  ;
  275.         SInt16                     windowItemCount  ;
  276.         WindowItemsArrayPtr     windowItems  ;
  277. };
  278. typedef struct WindowItemRec WindowItemRec, *WindowItemRecPtr,**WindowItemRecHandle;
  279.  
  280.         
  281. struct ProcTableRec {
  282.     EventProcs         EventProcsArray[kMaxEventProcs];
  283.     TerminateProc     Terminate ;
  284.     InitializeProc     Initialize;
  285.     LowMemProc         LowMem ;
  286.     MenuEventProc     MenuEvent ;
  287.     AboutProc         About;
  288.     OpenDocProc     openDocAE ;
  289.     OpenAppProc     openAppAE;
  290.     QuitAppProc     quitAppAE;
  291.     PrintDocProc     printDocAE;
  292. };
  293.  
  294.  
  295. #if __POWERPC__
  296.  
  297. #else
  298. #define gSACurrentWindow GSACURRENTWINDOW
  299. #define gSACurControl GSACURCONTROL
  300. #define gSAVPageSize GSAVPAGESIZE
  301. #define gSAHPageSize GSAHPAGESIZE
  302. #define gSAVLineSize GSAVLINESIZE
  303. #define gSAHLineSize GSAHLINESIZE
  304. #define gSAEvent     GSAEVENT
  305. #define gSAProcs    GSAPROCS
  306. #define gSAMac    GSAMAC
  307. #endif
  308.  
  309.  
  310. typedef struct ProcTableRec ProcTableRec, *ProcTablePtr;
  311. /*---------------------------------------------------------------------------------- */
  312. #pragma mark Globals
  313. /*---------------------------------------------------------------------------------- */
  314. extern    ListRef         gSAMyList  ;
  315. extern    SInt16             gSATerminateReason ;     /* When Quiting this tells us why we are quiting */
  316. extern    Boolean         gSADebug ;            /* Activate Debug Alerts. May make this an SInt16 */
  317.                                         /* for levels of debug */
  318. extern    ProcTableRec    gSAProcs  ;
  319. extern    Boolean         gOApped  ;
  320. extern    Boolean         gSADone  ;
  321. extern    Boolean         gSAHasAppleEvents  ;
  322. extern    Boolean         gSAHasTE  ;
  323. extern    Boolean         gSAHasList  ;
  324. extern    MenuRef         gSAAppleMenu  ;
  325. extern    MenuRef         gSAFileMenu  ;
  326. extern    MenuRef         gSAEditMenu  ;
  327. extern    EventRecord     gSAEvent  ;
  328. extern    Boolean         gSAHasControls  ;
  329. extern    WindowRef         gSACurrentWindow  ;
  330. extern    SInt16             gSADefaultFont  ;
  331. extern    SInt16             gsADefaultSize  ;
  332. extern    SysEnvRec         gSAMac  ;
  333. extern    WindowItemRecHandle gSACurWRecHandle  ;
  334. extern    SInt16             gSAWindowID  ;
  335. extern    TEHandle         gSACurTE  ;
  336. extern     ControlHandle     gSACurControl;
  337. extern    ListRef         gSACurList  ;
  338. extern     SInt16             gSACurrentItem;
  339.  
  340. /*---------------------------------------------------------------------------------- */
  341. #pragma mark Prototypes
  342. /*---------------------------------------------------------------------------------- */
  343.  
  344. pascal    SInt16    SAExecuteScript(SInt16 resID);
  345. pascal    void    SAMoveObject (ObjectItemRecHandle orh,SInt16 h,SInt16 v, Boolean reDraw);
  346. pascal    void    SADrawGroup(GroupRecHandle    grh,RgnHandle update);
  347.  
  348. pascal    void    InitSimpleApp (SInt16 masters ,  Boolean wantsStandardMenu);
  349. pascal    void    Run(void);
  350. pascal    void    CloseSimpleApp(void);
  351. pascal  void    SADoWindowClose(WindowRef * theWindow);
  352.  
  353. pascal    SInt16 DefaultMenuHit ( SInt32 modifiers);
  354. pascal    SInt16 InstallMenuItem (SInt16 menuID, 
  355.                                 SInt16 MenuItem,
  356.                                 ConstStr255Param menuTitle, 
  357.                                 UInt8 mark,
  358.                                 UInt8 cmdChar,
  359.                                 MenuHitProc menuHit,
  360.                                 MenuUpdateProc menuUpdate);
  361.  
  362. pascal    SInt16 InstallPushButton (SInt32 *buttonID,
  363.                                  WindowRef window,
  364.                                  ConstStr255Param name,
  365.                                  Rect *r,
  366.                                  UInt8 cmdKey,
  367.                                  ButtonHitProc bhp ,
  368.                                  ButtonUpdateProc bup  );
  369.                                  
  370. pascal     SInt16 InstallCustomObject (SInt32 * objectID,
  371.                                     WindowRef window ,
  372.                                     ConstStr255Param name ,
  373.                                     Rect * r ,
  374.                                     UInt8 cmdKey ,
  375.                                     ObjectInitProc oip ,
  376.                                     ObjectDisposeProc odp ,
  377.                                     ObjectHitProc ohp ,
  378.                                     ObjectTrackProc otp ,
  379.                                     ObjectUpdateProc oup );
  380.                                     
  381. pascal SInt16 InstallControl (SInt32 * buttonID,
  382.                              WindowRef window,
  383.                              ConstStr255Param name,
  384.                              Rect *  r ,
  385.                              UInt8 cmdKey,
  386.                              SInt16 controlType,
  387.                              ButtonHitProc bhp ,
  388.                              ButtonUpdateProc bup );
  389.                              
  390. pascal SInt16 InstallCheckBox (SInt32 *buttonID,
  391.                              WindowRef window,
  392.                              ConstStr255Param name,
  393.                              Rect *  r ,
  394.                              UInt8 cmdKey,
  395.                              SInt16 initialValue, 
  396.                              ButtonHitProc bhp ,  /* set to nil for default checkbox action */
  397.                              ButtonUpdateProc bup );
  398.                              
  399. pascal    SInt16 InstallScrollBar (SInt32 * buttonID,
  400.                                  WindowRef window,
  401.                                  ConstStr255Param name,
  402.                                  Rect *r,
  403.                                  UInt8 cmdKey,
  404.                                  MyActionProc scrollHitProc ,
  405.                                  MyActionProc scrollButtonProc ,
  406.                                  MyActionProc  scrollIndicatorProc);
  407.                                  
  408. pascal SInt16 InstallRadioGroup (SInt16 theGroupID,
  409.                                 WindowRef window, 
  410.                                 SInt16 count, 
  411.                                 ConstStr255Param title,
  412.                                 StringArrayPtr names,
  413.                                 Rect * r, 
  414.                                 SInt16 defaultItem,
  415.                                 SInt16 hSpacing,
  416.                                 SInt16 vSpacing,
  417.                                 SInt16 buttonHeight,
  418.                                 SInt16 buttonWidth,
  419.                                 PreGroupHitProc PreGHP, 
  420.                                 PostGroupHitProc PostGHP, 
  421.                                 GroupUpdateProc gup );
  422.  
  423. pascal    SInt16 CreateDocumentWindow (ConstStr255Param name  ,
  424.                                     Rect * bounds  ,
  425.                                     Boolean visable );
  426. pascal void SAInitScripting(void);    
  427.                                 
  428. pascal    SInt16 GetDocumentWindow (  SInt16 resID);
  429.  
  430. pascal    void Print (Str255 s );                   /* Print no CR */
  431. pascal    void PrintLine (Str255 s);                /* Print with CR */
  432. pascal    void PrintTextHandle (Handle text  );     /* Print a buffer full of text with CR */
  433.  
  434. pascal    void SetRectLocation ( Rect *r,SInt16 h, SInt16 v);            /* This Sets a rects anchor point */
  435. pascal    void SetRectDimensions (Rect *r,SInt16 h, SInt16 v);            /* This Sets its size without changing its position */
  436.  
  437. pascal    void GetPrintArea (WindowRef window ,Rect * bounds );
  438. pascal    void SetPrintArea (WindowRef window, Rect * bounds );
  439.  
  440. pascal    EditFieldItemRecHandle SAGetEditField (WindowRef wind,SInt16 editID) ;
  441. pascal    void SASetFocus (WindowRef theWindow, EditFieldItemRecHandle efrh);
  442.  
  443. pascal    SInt16 InstallEditField (SInt32 * editID , 
  444.                                 WindowRef window,
  445.                                 ConstStr255Param name  ,
  446.                                 Rect * r,
  447.                                 EditFieldHitProc hitProc  ,
  448.                                 EditFieldUpdateProc updateProc  ,
  449.                                 ObjectKeyProc    keyProc    ,
  450.                                 SInt32 flags  );
  451.  
  452. pascal    SInt16 InstallList (SInt32 * listID  , 
  453.                             WindowRef window,
  454.                             Rect * r,
  455.                             ListHitProc lhp  , 
  456.                             ListUpdateProc lup  ,
  457.                             ListDrawCellProc ldcp  , 
  458.                             SInt32 flags );
  459.  
  460. pascal    SInt16 GetTEString (SInt16 editFieldID  ,ConstStr255Param s  ) ;
  461. pascal    OSErr AddStringToList (ListRef listID  ,ConstStr255Param s  );
  462.  
  463. pascal    void BlastString (SInt16 h, SInt16 v  ,Str255 s  ); /* These will blast text at the location specified. It erases as it draws */
  464. pascal    void BlastText (SInt16 h,SInt16 v  ,Handle text  );
  465. pascal    void InstallIdleProc(EventProcs  ip);
  466. pascal  void SetMyTitle(Str255 title);
  467. pascal  void SAEnableMe(void);
  468. pascal  void SADisableMe(void);
  469. pascal  void SAEnableObject(SInt32 thing);
  470. pascal  void SADisableMe();
  471. pascal     ButtonItemRecHandle SAGetGroupItem(WindowRef wind,SInt16 groupID,SInt16 item);
  472. pascal    SInt16 SADrawObject(ObjectItemRecHandle orh,RgnHandle update);
  473. pascal     SInt16 InstallStaticText(SInt32 * textID,WindowRef window,ConstStr255Param s ,Rect *r);
  474. pascal  void  ErrorMessage(ConstStr255Param msg,SInt32 error,SInt16 flags);
  475.  
  476. pascal    Handle SAGetObjectHandle(long thing);
  477.  
  478. pascal  void   SetWindowHitProc     (WindowRef window,WindowHitProc     theProc );
  479. pascal  void   SetWindowUpdateProc    (WindowRef window,WindowUpdateProc     theProc );
  480. pascal  void   SetWindowIdleProc    (WindowRef window,WindowIdleProc     theProc );
  481. pascal  void   SetWindowGrowProc    (WindowRef window,WindowGrowProc     theProc );
  482. pascal  void   SetWindowActivateProc(WindowRef window,WindowActivateProc theProc );
  483. pascal  void   SetWindowCloseProc     (WindowRef window,WindowCloseProc     theProc );
  484. pascal  void   SetWindowZoomProc     (WindowRef window,WindowZoomProc     theProc );
  485. pascal  void   SetWindowFSSpec         (WindowRef window,FSSpecPtr   FSSpec);
  486.  
  487. pascal     OSErr  GetWindowFSSpec         (WindowRef window,FSSpecPtr  theFSSpec );
  488. pascal    WindowCloseProc  GetWindowCloseProc (WindowRef window);
  489.  
  490. #endif    
  491.